﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Procenge.PortalVendas.Models.Produto>"%>
<%@ Import Namespace="Procenge.PortalVendas.Models" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Create
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Create</h2>

    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>

        <fieldset>
            <legend>Fields</legend>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.codigo) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.codigo) %>
                <%: Html.ValidationMessageFor(model => model.codigo) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.nome) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.nome) %>
                <%: Html.ValidationMessageFor(model => model.nome) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.fornecedor_cnpj) %>
            </div>
            
            
            <select name="nome" class="selected" style="width: 220px;">
                <option> Selecione o Fornecedor </option>
               <% 
                 ModelFornecedor f = new ModelFornecedor();
                 
                  foreach (var item in f.exibirTodos()){
                      %> 
                  <option selected="<%=item.cnpj%>"><%=item.nome%></option>    
                 <% }
             %>
                           
              
            </select>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.qtd) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.qtd) %>
                <%: Html.ValidationMessageFor(model => model.qtd) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.descricao) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.descricao) %>
                <%: Html.ValidationMessageFor(model => model.descricao) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.secao) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.secao) %>
                <%: Html.ValidationMessageFor(model => model.secao) %>
            </div>
            
            <div class="editor-label">
                <%: Html.LabelFor(model => model.preco) %>
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.preco) %>
                <%: Html.ValidationMessageFor(model => model.preco) %>
            </div>
            
            <p>
                <input type="submit" value="Create" />
            </p>
        </fieldset>

    <% } %>

    <div>
        <%: Html.ActionLink("Back to List", "Index") %>
    </div>

</asp:Content>

